package com.vietnam.power.persitence;

import java.io.Serializable;
import javax.persistence.*;


/**
 * The persistent class for the user_role database table.
 * 
 */
@Entity
@Table(name="user_role")
public class UserRole implements Serializable {
	private static final long serialVersionUID = 1L;
	private int id;
	private UserInfo userInfo;
	private UserRoleInfo userRoleInfo;

	public UserRole() {
	}

	public UserRole(UserInfo userInfo, UserRoleInfo userRoleInfo) {
		this.userInfo = userInfo;
		this.userRoleInfo = userRoleInfo;
	}
	
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	public int getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}


	//bi-directional many-to-one association to UserInfo
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="user_info_id")
	public UserInfo getUserInfo() {
		return this.userInfo;
	}

	public void setUserInfo(UserInfo userInfo) {
		this.userInfo = userInfo;
	}


	//bi-directional many-to-one association to UserRoleInfo
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="user_role_info_id")
	public UserRoleInfo getUserRoleInfo() {
		return this.userRoleInfo;
	}

	public void setUserRoleInfo(UserRoleInfo userRoleInfo) {
		this.userRoleInfo = userRoleInfo;
	}

}